package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.GroupChatMessageMapper;
import com.ruoyi.system.domain.GroupChatMessage;
import com.ruoyi.system.service.IGroupChatMessageService;

/**
 * 群聊消息记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-11-02
 */
@Service
public class GroupChatMessageServiceImpl implements IGroupChatMessageService 
{
    @Autowired
    private GroupChatMessageMapper groupChatMessageMapper;

    /**
     * 查询群聊消息记录
     * 
     * @param id 群聊消息记录主键
     * @return 群聊消息记录
     */
    @Override
    public GroupChatMessage selectGroupChatMessageById(Long id)
    {
        return groupChatMessageMapper.selectGroupChatMessageById(id);
    }

    /**
     * 查询群聊消息记录列表
     * 
     * @param groupChatMessage 群聊消息记录
     * @return 群聊消息记录
     */
    @Override
    public List<GroupChatMessage> selectGroupChatMessageList(GroupChatMessage groupChatMessage)
    {
        return groupChatMessageMapper.selectGroupChatMessageList(groupChatMessage);
    }

    /**
     * 新增群聊消息记录
     * 
     * @param groupChatMessage 群聊消息记录
     * @return 结果
     */
    @Override
    public int insertGroupChatMessage(GroupChatMessage groupChatMessage)
    {
        return groupChatMessageMapper.insertGroupChatMessage(groupChatMessage);
    }

    /**
     * 修改群聊消息记录
     * 
     * @param groupChatMessage 群聊消息记录
     * @return 结果
     */
    @Override
    public int updateGroupChatMessage(GroupChatMessage groupChatMessage)
    {
        return groupChatMessageMapper.updateGroupChatMessage(groupChatMessage);
    }

    /**
     * 批量删除群聊消息记录
     * 
     * @param ids 需要删除的群聊消息记录主键
     * @return 结果
     */
    @Override
    public int deleteGroupChatMessageByIds(Long[] ids)
    {
        return groupChatMessageMapper.deleteGroupChatMessageByIds(ids);
    }

    /**
     * 删除群聊消息记录信息
     * 
     * @param id 群聊消息记录主键
     * @return 结果
     */
    @Override
    public int deleteGroupChatMessageById(Long id)
    {
        return groupChatMessageMapper.deleteGroupChatMessageById(id);
    }

    @Override
    public List<GroupChatMessage> getHistoryMessages(GroupChatMessage groupChatMessage) {
        return groupChatMessageMapper.selectHistoryMessages(groupChatMessage);
    }
}
